﻿/* --------------------------------------------------------------
 * exMath (C) Laurens Ruijtenberg
 * 
 * This code is being distributed under the MS-PL license. Feel
 * free to contact me if you like this code.
 * -------------------------------------------------------------- */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using exMath.Common;

namespace exMath.Statistics
{
    /// <summary>
    /// Transformation functions to apply to bell-shaped curves.
    /// </summary>
    public class StatisticTransformations
    {
        public static double[] Square(double[] Values)
        {
            return Functions.ExecuteFunction(Values, delegate(double x)
            {
                return x * x;
            });
        }

        public static double[] SquareRoot(double[] Values)
        {
            return Functions.ExecuteFunction(Values, delegate(double x)
            {
                return Math.Sqrt(x);
            });
        }

        public static double[] Reciprocal(double[] Values)
        {
            return Functions.ExecuteFunction(Values, delegate(double x)
            {
                return 1.0 / x;
            });
        }
    }
}
